package com.ksyun.cloudhostalarmprocessing.controller;

import com.ksyun.cloudhostalarmprocessing.common.QueryRequest;
import com.ksyun.cloudhostalarmprocessing.common.QueryResponse;
import com.ksyun.cloudhostalarmprocessing.common.ResultSet;
import com.ksyun.cloudhostalarmprocessing.entity.vo.AlertDataVO;
import com.ksyun.cloudhostalarmprocessing.entity.vo.AlertVo;
import com.ksyun.cloudhostalarmprocessing.service.IAlertsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 李厚航
 * @since 2024-05-07
 */
@RestController
@RequestMapping("/alert")
public class AlertController {

    @Autowired
    IAlertsService alertsService;

    @CrossOrigin
    @PostMapping("/query")
    public QueryResponse<AlertDataVO> query(@RequestBody QueryRequest queryRequest){
        return alertsService.getByTimeStamp(queryRequest);
    }

}
